<template>
  <div class="dashboard">
    <h2>总文章数:{{dashboardData.articleCount}}</h2>
    <h2>总标签数:{{dashboardData.tagCount}}</h2>
    <h2>总留言数:{{dashboardData.commentCount}}</h2>
    <h2>总操作日志数:{{dashboardData.logCount}}</h2>
    <h2>总用户数:{{dashboardData.userCount}}</h2>
  </div>
</template>

<script>
import { createNamespacedHelpers } from "vuex";
const { mapActions } = createNamespacedHelpers("admin");
export default {
  data() {
    return {
      dashboardData: {},
    }
  },
  mounted() {
    this.dashboard().then((res) => {
      this.dashboardData = res;
    })
  },
  methods: {
    ...mapActions(["dashboard"]),
  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  height: 100%;
  display: flex;
  flex-flow: column;
  justify-content: center;
  align-items: center;
}
</style>